home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / Pascal / Applications / NIH Image 1.55 / Macros / Editing Macros < prev    next >
Encoding:
Text File  |  1994-04-20  |  5.2 KB  |  27 lines  |  [TEXT/Imag]

  1.  if x1<0 then begin
  2.      PutMessage('Click with line selection tool to define upper left corner of ROI.');
  3.      exit;
  4.   end;
  5.   RoiLeft:=x1+(x2-x1)/2;
  6.   RoiTop:=y1+(y2-y1)/2;
  7. end;
  8.  
  9. macro 'Define Lower Right and Create ROI [2]';
  10. var
  11.   x1,y1,x2,y2,LineWidth:integer;
  12. begin
  13.   GetLine(x1,y1,x2,y2,LineWidth);
  14.   if x1<0 then begin
  15.      PutMessage('Click with line selection tool to define lower right corner of ROI.');
  16.      exit;
  17.   end;
  18.   RoiRight:=x1+(x2-x1)/2;
  19.   RoiBottom:=y1+(y2-y1)/2;
  20.   if (RoiLeft=RoiRight) and (RoiTop=RoiBottom) then begin
  21.     PutMessage('Upper left and bottom right are the same.');
  22.     exit;
  23.   end;
  24.   MakeRoi(RoiLeft,RoiTop,RoiRight-RoiLeft,RoiBottom-RoiTop)
  25. end;
  26.  
  27.